package com.leen.controller;

import com.leen.aspect.annon.LogDB;
import com.leen.aspect.logdb.ModuleEnum;
import com.leen.aspect.logdb.OperationEnum;
import com.leen.common.vo.ResultVO;
import com.leen.entity.Coupon;
import com.leen.entity.Teacher;
import com.leen.service.CouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@Api(tags = "教师接口")
@RequestMapping(value = "/leen/coupon")
public class CouponController {
    @Autowired
    private CouponService couponService;

    @GetMapping(value = "/add")
    @ApiOperation(value = "新增优惠卷")
    @LogDB(module = ModuleEnum.COURSE_MODULE,operation = OperationEnum.INSERT)
    public ResultVO<String> add(@RequestBody @Valid Coupon coupon){
        return this.couponService.insert(coupon);
    }
}
